package com.kjw.learn.springboot.chapter3.controller;

import com.kjw.learn.springboot.chapter3.service.ZuFangService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @Author: KuangJieWen
 * @Date: 2018/1/23 11:24
 * @Description:天河租房信息Controller
 */
@RestController
public class ZuFangController {
    @Autowired
    private ZuFangService zuFangService;

    @RequestMapping("/get/all")
    public List<Map> getAll(){
        return zuFangService.getAll();
    }
    @RequestMapping("/hello")
    public String hello(){
        return "Hello Spring Boot";
    }

    @RequestMapping("/save")
    public int save(){
        Map param=new HashMap();
        param.put("title","kjw测试");
        param.put("url","91porn");
        zuFangService.save(param);
        ThreadLocal local=new ThreadLocal();
        return 50;
    }
}
